package yag.battle.pet.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yag.battle.pet.dao.PetDao;
import yag.battle.pet.model.Pet;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by user on 31.08.2014.
 */
@Service
public class PetService {
    @Autowired
    private PetDao dao;

    public int create(Pet pet) {
        return dao.create(pet);
    }

    public Pet getById(int id) {
        return dao.getById(id);
    }

    public Pet getByUser(int id) {
        return dao.getByUser(id);
    }

    public List<Pet> getList() {
        return dao.getList();
    }

    public void updateUserId(int id, int idUser) {
        this.dao.updateUserId(id, idUser);
    }

    public void updateById(int id, Pet pet) {
        this.dao.updateById(id, pet);
    }

    public void updateByUserId(int idUser, Pet pet) {
        this.dao.updateByUserId(idUser, pet);
    }

    public void deleteById(Integer id) {
        this.dao.deleteById(id);
    }

    public void deleteByUserId(Integer id) {
        this.dao.deleteByUserId(id);
    }

    public void deleteUserIdById(int id) {
        this.dao.deleteUserIdById(id);
    }

}
